package com.biomatch.config;

import com.biomatch.response.RestResult;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

import com.biomatch.response.RestResponse;

/**
 * 全局异常处理
 */

@ControllerAdvice
public class ExceptionHandlerConfig {

    @ResponseBody
    @ExceptionHandler(value = Exception.class)
    public RestResult<Boolean> exceptionHandler (Exception e) {
        e.printStackTrace();
        return RestResponse.error(e.getMessage());
    }
}
